﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BluePumpkin.Library.AppCode.Context;
namespace BluePumpkin.Library
{
    class EventManager
    {
        public void AddEvent(Events _eventclass)
        {
            using (BdbContext DBContext = new BdbContext())
            {
                Events _event = new Events
                {
                    Title = _eventclass.Title,
                    EventDate = System.DateTime.Now,
                    WinnerId = _eventclass.WinnerId,
                    EventDetail = _eventclass.EventDetail
                };
                DBContext.Events.Add(_event);
                DBContext.SaveChanges();
            }

        }
    }
}
